<?php

namespace Openfennec\CoreBundle\Twig;

class OpenfennecExtension extends \Twig_Extension {
    public function getFilters()
    {
        return array(
            new \Twig_SimpleFilter("gravatar", function ($email, $size = 96){
                $email = strtolower(trim($email));
                $md5 = md5($email);
                $link = "http://www.gravatar.com/avatar/".$md5."?s=".$size;
                return $link;
            }),
        );
    }
    
    public function getName() {
        return "openfennec_extension";
    }
}
